<template>
    <van-nav-bar title="拼团详情" left-text="" left-arrow @click-left="goBack" />
    <div class="rank_header">
        <div class="title">
            <span>商品热销榜</span>
        </div>
    </div>
    <div class="rank_box">
        <div class="item" v-for="item in teamlist" :key="item.id">
            <div class="top">
                <div class="img">
                    <router-link :to="{ path: '/product/info', query: { proid: item.product.id } }"><img
                            :src="item.product.thumbs_text" /></router-link>
                </div>
                <div class="content ">
                    <div class="title">{{ item.product.name }}</div>
                    <p class="middle"><span>值得买</span>好心动抹浓郁显色</p>
                    <p class="desc">“很好看宝宝们”</p>
                </div>
            </div>
            <div class="footer">
                <div class="price">
                    ￥<span>{{ item.product.team }}</span>
                    券后价
                    <span>极速退款</span>
                </div>
                <div class="btn" @click="toInfoPages">
                    去购买>
                </div>
            </div>
            <div class="tip">
                <img src="/assets/images/hot.png" alt="">
                <span>热销指数9.9</span>
            </div>
        </div>
    </div>
</template>
<script setup>
const { proxy } = getCurrentInstance()
const LoginUser = reactive(proxy.$cookies.get('LoginUser'));
import Footer from '@/components/common/footer.vue';
const teamlist = ref([])
onBeforeMount(() => {
    getRankingData()
})
const getRankingData = async () => {
    let result = await Api.RankingIndex()
    if (result.code == 1) {
        teamlist.value = result.data
        console.log(teamlist.value)
    }
}
const toInfoPages = (id) => {
    proxy.$router.push({
        path: '/team/info',
        query: {
            teamid: id
        }
    })
}
</script>
<style>
@import url('/assets/css/ranking.css');
</style>